﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

using Business;

namespace GestorEventos
{
    public partial class addPalcoEvento : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            ListaPalco business = new ListaPalco();
            ListaPalco listaPalco = new ListaPalco(business.getListaPalcos(1));
            for (int i = 0; i < listaPalco.getListaPalco().Count; i++) {
                DropDownListPalcos.Items.Add(listaPalco.getListaPalco()[i].getNomePalco());
            }
        }

        public void adicionarPalco(Object o, EventArgs e)
        {


            if (Request.QueryString["eventID"] != null)
            {
                int eventID = Convert.ToInt32(Request.QueryString["eventID"].ToString());

                
                String nome = DropDownListPalcos.SelectedValue;

                ListaPalco business = new ListaPalco();
                ListaPalco listaPalco = new ListaPalco(business.getListaPalcos(1));

                int palcoID = listaPalco.getPalcoIDByNome(nome);

                Evento evento = new Evento();

                //bool value = evento.insertArtistEvent(eventID, artistaID, data);
                LabelSeleccionar.Text = evento.insertPalcoEvento(eventID, palcoID).ToString();
                Label1.Text = nome;
                /*
                if (value) {
                    ButtonAddArtista.Text = "Cenassona";
                }
                if (!value) {
                    ButtonAddArtista.Text = "FAILZAO";
                }*/

            }
        }



    }
}
